/* 
 * File:   Drawer.cpp
 * Author: maciekmp
 * 
 * Created on 29 listopad 2011, 17:41
 */

#include "Drawer.h"

XnPoint3D Drawer::pointer;
int Drawer::windowH;
int Drawer::windowW;

void Drawer::drawHud() {
    //setting ortho
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    gluOrtho2D(0, windowW, windowH, 0);
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();                         // Push The Matrix
    glLoadIdentity();


    //private draw pointer:
    glPushMatrix();
    glTranslatef(pointer.X, pointer.Y, 0.0f);

    glScalef(0.5f, 0.5f, 0.5f);

    glColor4f(0.0f, 0.0f, 0.0f, 1.0);
    glBegin(GL_QUADS);

    glTexCoord2f(0.0f, 1.0f);
glVertex2i(-50, -50);

    glTexCoord2f(1.0f, 1.0f);
glVertex2i(50, -50);
    
    glTexCoord2f(1.0f, 0.0f);
glVertex2i(50, 50);
    
    glTexCoord2f(0.0f, 0.0f);
glVertex2i(-50, 50);
    
    glEnd();
    glPopMatrix();
    
    //back
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
}


